<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function foo() {
        for (let i = 0; i < 100000; i++) {
            if (i === 99999) console.log('start')
        }

        setTimeout(() => console.log('setTimeout'))

        function test() {
            Promise.resolve().then()
        }

        async function test2() {
            await test()
            console.log('22222')
        }

        new Promise(resolve => {
            resolve()
            console.log('promise')
        }).then(res => console.log('then'))

        test2()

        console.log('end')
    }
    foo()
</script>
</body>
</html>
